﻿<%@ Page Title="View Album Page" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master"
    CodeBehind="ViewAlbum.aspx.vb" Inherits="BeachesInGreeceComplete.ViewAlbum" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </ajaxToolkit:ToolkitScriptManager>
    <div class="aside2">
        <br />
        <h3>
            Description</h3>
        <br />
        <br />
        <div class="Justified">
            <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource3">
                <ItemTemplate>
                    <%# Eval("Description") %>
                </ItemTemplate>
            </asp:Repeater>
            <br />
            <br />
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:Button ID="btn_VoteAlbum" runat="server" Text="Vote" CssClass="m-btn blue" />
                    <asp:Repeater ID="rpt_Votes" runat="server" DataSourceID="SqlDataSource4">
                        <ItemTemplate>
                            •
                            <asp:Label ID="lbl_Views" runat="server" Text='<%# Eval("TotalVotes") %>' CssClass="myButton" />
                        </ItemTemplate>
                    </asp:Repeater>
                    <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:BeachConnectionString %>"
                        ProviderName="<%$ ConnectionStrings:BeachConnectionString.ProviderName %>" SelectCommand="SELECT * FROM [TotalVotesPerAlbum] WHERE ([ID] = ?)">
                        <SelectParameters>
                            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:BeachConnectionString %>"
            ProviderName="<%$ ConnectionStrings:BeachConnectionString.ProviderName %>" SelectCommand="SELECT * FROM Albums WHERE ID = ?">
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
    <h2 id="myHeading" runat="server">
    </h2>
    <div class="mainDiv2">
        <asp:ListView ID="ListView1" runat="server" DataKeyNames="ID" DataSourceID="SqlDataSource1">
            <ItemTemplate>
                <li class="hoverClass">
                    <asp:Label ID="lbl_Name" CssClass="BeachNameLabel" runat="server" Text='<%# Eval("Location") %>' />
                    <br />
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ID", "ViewFullAlbumPicture.aspx?ID={0}") %>'>
                        <img src='<%# Eval("Thumbnail") %>'  alt="No picture found"  width="100" height="100" style="border-style: solid; border-width: medium" />
                    </asp:HyperLink>
                    <br />
                    <asp:Label ID="lbl_Region" CssClass="RegionLabel" runat="server" Text='<%# Eval("Description") %>' />
                    <br />
                    <br />
                </li>
            </ItemTemplate>
            <LayoutTemplate>
                <ul class="ItemContainer">
                    <li runat="server" id="itemPlaceholder" />
                </ul>
            </LayoutTemplate>
        </asp:ListView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:BeachConnectionString %>"
            ProviderName="<%$ ConnectionStrings:BeachConnectionString.ProviderName %>" SelectCommand="SELECT [ID], [Albums_FK], [Thumbnail], [Description], [Location] FROM [Album_Photos] WHERE ([Albums_FK] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="Albums_FK" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
</asp:Content>
